#include <string.h>

void recortar_c (
	unsigned char *src,
	unsigned char *dst,
	int m,
	int n,
	int src_row_size,
	int dst_row_size,
	int x,
	int y,
	int tam
) {
	int alto_original = m;
	int ancho_original = n; // nombres declarativos

	int primera_columna = x;
	int primera_fila = y;

	unsigned char* puntero_a_fila = src +  (src_row_size * primera_fila);

	for (int indice_fila = 0; indice_fila < tam; indice_fila++) {
		unsigned char* fila_origen = puntero_a_fila + (indice_fila * src_row_size);
		unsigned char* fila_destino = dst + (indice_fila * dst_row_size);
		for (int indice_col = 0;indice_col < tam; indice_col++) {
		unsigned char byte = fila_origen[primera_columna + indice_col];
		fila_destino[indice_col] = byte;

		}


		//memcpy(fila_origen, fila_destino, tam);	
	}
}
